package com.jwthhealth_pub.old.report.view.widget;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;

import com.jwthhealth_pub.R;

/**
 * 运动建议分隔线
 * Created by liuzhen on 2017/10/25.
 */

public class Jwht_HorizontalLine extends View {
    public Jwht_HorizontalLine(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        int width = canvas.getWidth();
        int height = canvas.getHeight();

        Paint paint = new Paint();
        paint.setAntiAlias(true);
        paint.setStrokeWidth(2);
        paint.setColor(getResources().getColor(R.color.black));
//        canvas.drawLine(0, 20, width / 2 - 20, 20, paint);
//        canvas.drawLine(width / 2 - 20, 20, width / 2, 0, paint);
//        canvas.drawLine(width / 2, 0, width / 2 + 20, 20, paint);
//        canvas.drawLine(width / 2 + 20, 20, width, 20, paint);
        canvas.drawLine(0, 20 , width, 20, paint);
    }
}
